package com.hikari.ai.oldpathfinding;

import java.awt.Graphics;

/**
 * @author Dmitry
 */
public class MySector extends MyCircle {
    private float angle;
    private float angleExtent;

    public MySector() {
    }

    public MySector(int x, int y, int radius) {
        super(x, y, radius);
    }

    public float getAngle() {
        return angle;
    }

    public void setAngle(float angle) {
        this.angle = angle;
    }

    public float getAngleExtent() {
        return angleExtent;
    }

    public void setAngleExtent(float angleExtent) {
        this.angleExtent = angleExtent;
    }

    @Override
    public boolean circleIntersect(MyCircle circle) {
        if (!super.circleIntersect(circle)) {
            return false;
        }

        return true;
    }

    @Override
    public void draw(Graphics g) {
        g.drawArc(x - radius, y - radius, radius * 2, radius*2, 360-(int) Math.toDegrees(angle), (int) Math.toDegrees(angleExtent));
    }

    @Override
    public String toString() {
        return "X=" + x + " Y=" + y + " R=" + radius + " a1=" + Math.toDegrees(angle) + " extent=" + Math.toDegrees(angleExtent);
    }
}
